<template>
  <div class="lq">
    <div class="lqyhq">
      <div
        class="lqyhq-item"
        v-for="item in list"
        :key="item.id"
      >
        <div class="yhq-l">
          <p>${{item.money}}</p>
          <span>满{{item.minPrice}}可用</span>
        </div>
        <div
          class="yhq-r"
          @click="item.isUse=!item.isUse"
        >{{item.isUse?"领取":"已领取"}}</div>
      </div>
    </div>
  </div>

</template>
<script>
export default {
  data() {
    return {
      list: []

    }
  },
  methods: {
    async getCoupons() {
      const res = await this.$http.getCoupons()
      console.log(res.data.data);
      this.list = res.data.data
    }

  },
  created() {
    this.getCoupons()
    console.log(this.list);
  }

}
</script>
<style lang="scss" scoped>
* {
  margin: 0;
  padding: 0;
}
.lq {
  height: 90px;
  overflow: hidden;
  box-sizing: border-box;
  margin-left: 20px;
  .lqyhq {
    display: flex;

    overflow: auto hidden;

    .lqyhq-item {
      width: 133px;
      height: 100px;
      margin-right: 14px;
      border-radius: 7px;
      position: relative;

      display: flex;

      .yhq-l {
        width: 104px;
        height: 70px;
        border-radius: 7px 0 0 7px;
        text-align: center;
        color: red;
        background-color: pink;
        p {
          font-size: 20px;
          margin-bottom: 5px;
          font-weight: bold;
          margin-top: 10px;
        }
      }
      .yhq-r {
        width: 20px;
        text-align: center;
        height: 70px;
        background-color: red;
        color: white;
        padding-top: 10px;
        box-sizing: border-box;
        border-radius: 0 7px 7px 0;
      }
    }
  }
}
</style>